const host = require('../../config').host
const app = getApp()

Page({
    data: {
        //判断小程序的API，回调，参数，组件等是否在当前版本可用。
        canIUse: wx.canIUse("button.open-type.getUserInfo")
        // canIUse: wx.canIUse("button.open-type.getUserInfo")
    },
    token: function (e){
    	// console.log(e.detail.data[0]);

        try {
          const value = wx.setStorageSync('token', e.detail.data[0])
          if(value){

          }
        } catch (e) { }
        wx.navigateBack({
          delta:1,
          success: function(){
            var page = getCurrentPages().pop();
            // console.log(page);
            if (page == undefined || page == null) return;
            page.onLoad();
          }
        })
   //  	wx.setStorageSync({
			//   token: e.detail.data[0]
			// })
    },
    onLoad: function () {
        var that = this;
        // console.log(1111);
        // var page = getCurrentPages().pop();
        // console.log(page);
        // if (page == undefined || page == null) return;
        // page.onLoad();

        
        
    },
    
    
})